//
//  YBNews.m
//  解析HTML
//
//  Created by 尚往文化 on 17/9/13.
//  Copyright © 2017年 YBing. All rights reserved.
//

#import "YBNews.h"

@implementation YBNews

+ (instancetype)newsWithTitle:(NSString *)title desc:(NSString *)desc url:(NSString *)url img:(NSString *)img time:(NSString *)time category:(NSString *)category source:(NSString *)source likenum:(NSString *)likenum
{
    YBNews *news = [self new];
    news.title = title;
    news.desc = [desc stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
    news.url = url;
    news.img = img;
    news.time = time;
    news.category = category;
    news.source = source;
    news.likenum = likenum;
    return news;
}

- (void)setTitle:(NSString *)title
{
    _title = [[title stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] copy];
}

- (void)setDesc:(NSString *)desc
{
    _desc = [[desc stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] copy];
}

@end
